<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>商家管理控制台</title>
<link rel="shortcut icon" href="${pageContext.request.contextPath}/images/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/css/identify.css" />
	<link href="${pageContext.request.contextPath}/css/css.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath}/css/style2.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/css/layout.css" />
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/css/account.css" />
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/css/style.css" />
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/css/control_index.css" />
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/css/page.css" />
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/haidao.offcial.general.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/select.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/haidao.validate.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/page.js"></script>
</head>
<body>
	<!-- 顶层导航栏 -->
	<div class="view-topbar">
		<div class="topbar-console">
			<div class="tobar-head fl">
				<a href="#" class="topbar-logo fl"> <span><img
						src="${pageContext.request.contextPath}/images/logo.png"
						width="20" height="20" /></span>
				</a> <a href="${pageContext.request.contextPath}/pages/index.jsp"
					class="topbar-home-link topbar-btn text-center fl"><span>商户管理控制台</span></a>
			</div>
		</div>
		<div class="topbar-info">
			<ul class="fr">
				<li class="fl topbar-info-item">
					<div class="dropdown">
						<a href="#" class="topbar-btn"> <span class="fl text-normal">${saleAccount}</span>
							<span class="icon-arrow-down"></span>
						</a>
						<ul class="dropdown-menu">
							<li><a href="${pageContext.request.contextPath}/pages/user/login.jsp">注销</a></li>
						</ul>
					</div>
				</li>
			</ul>
		</div>
	</div>
	<!-- 顶层往下所有内容view-body -->
	<div class="view-body">
		<!-- 左侧导航栏 -->
		<div class="view-sidebar">
			<div class="sidebar-content">
				<!-- 左侧子导航栏 -->
				<div class="sidebar-nav ">
					<div class="sidebar-title">
						<a href="#"> <span class="icon"><b
								class="fl icon-arrow-down"></b></span> <span class="text-normal">权限申请</span>
						</a>
					</div>
					<ul class="sidebar-trans">
						<li><a href="<%=request.getContextPath()%>/sale/infoShow">
								<b class="sidebar-icon"><img
									src="${pageContext.request.contextPath}/images/icon_message.png"
									width="16" height="16" /></b> <span class="text-normal">申请入驻</span>
						</a></li>
					</ul>
				</div>
				<div class="sidebar-nav">
					<div class="sidebar-title">
						<a href="#"> <span class="icon"><b
								class="fl icon-arrow-down"></b></span> <span class="text-normal">商品中心</span>
						</a>
					</div>
					<ul class="sidebar-trans">
						<li><a href="${pageContext.request.contextPath}/goods/goods">
								<b class="sidebar-icon"><img
									src="${pageContext.request.contextPath}/images/icon_author.png"
									width="16" height="16" /></b> <span class="text-normal">商品管理</span>
						</a></li>
						<li><a href="${pageContext.request.contextPath}/goods/toAdd">
								<b class="sidebar-icon"><img
									src="${pageContext.request.contextPath}/images/icon_author.png"
									width="16" height="16" /></b> <span class="text-normal">商品添加</span>
						</a></li>
					</ul>
				</div>
				<div class="sidebar-nav">
					<div class="sidebar-title">
						<a href="#"> <span class="icon"><b
								class="fl icon-arrow-down"></b></span> <span class="text-normal">个人中心</span>
						</a>
					</div>
					<ul class="sidebar-trans">
						<li><a
							href="${pageContext.request.contextPath}/saleInfo/getSaleInfo">
								<b class="sidebar-icon"><img
									src="${pageContext.request.contextPath}/images/icon_order.png"
									width="16" height="16" /></b> <span class="text-normal">个人信息</span>
						</a></li>

					</ul>
				</div>
				<div class="sidebar-nav">
					<div class="sidebar-title">
						<a href="#"> <span class="icon"><b
								class="fl icon-arrow-down"></b></span> <span class="text-normal">子账号中心</span>
						</a>
					</div>
					<ul class="sidebar-trans">
						<li><a
							href="${pageContext.request.contextPath}/babyAccount/newQuery">
								<b class="sidebar-icon"><img
									src="${pageContext.request.contextPath}/images/icon_cost.png"
									width="16" height="16" /></b> <span class="text-normal">子账号查询</span>
						</a></li>
						<li><a
							href="${pageContext.request.contextPath}/babyAccount/toAdd">
								<b class="sidebar-icon"><img
									src="${pageContext.request.contextPath}/images/icon_cost.png"
									width="16" height="16" /></b> <span class="text-normal">子账号添加</span>
						</a></li>
					</ul>
				</div>
				<div class="sidebar-nav">
					<div class="sidebar-title">
						<a href="#"> <span class="icon"><b
								class="fl icon-arrow-down"></b></span> <span class="text-normal">订单管理</span>
						</a>
					</div>
					<ul class="sidebar-trans">
						<li><a href="${pageContext.request.contextPath}/saleOrder/saleOrderList">
								<b class="sidebar-icon"><img src="${pageContext.request.contextPath}/images/icon_gold.png" width="16" height="16" /></b>
								<span class="text-normal">订单查询</span>
							</a>
						</li>
					</ul>
				</div>
			</div>
		</div>





		<div class="view-product">
			<!-- 业务内容标题 -->
			<div class="authority-head">
				<div class="manage-head">
					<h6 class="layout padding-left manage-head-con">商品管理</h6>
				</div>
			</div>
			<form action="${pageContext.request.contextPath}/goods/queryByCon"
				method="post" autocomplete="off" onSubmit="return chkads()" id="my">
				<!-- 分配两侧空间 -->
				<div class="basic-info-detail clearfix">
					<div class="real-name-con height-main margin-top-25 clearfix">
						<p class="content-left-zoon">手机编号：</p>
						<div>
							<input class="width-main input" placeholder="按编号查询" type="text"
								name="id" id="i" autofocus value="${listid}" maxlength="11" />
						</div>
					</div>
					<div class="real-name-con h eight-main margin-top-25 clearfix">
						<p class="content-left-zoon">手机名称：</p>
						<input class="width-main input" placeholder="按名称查询" type="text"
							name="goodsName" id="g" value="${listname}" />
					</div>


					<div class="real-name-con height-main margin-top-25 clearfix">
						<div class="margin-large-top padding-left text-left ">
							<input type="submit" value="查询" class="submit fl"
								onclick="tableHi()">
						</div>
					</div>
					</br>
			</form>
			<div class="authority-content" id="ta">
				<div class="list-content show">
					<div class="offcial-table tr-border margin-big-top clearfix">
						<div class="tr-th clearfix">
							<div class="th w5">手机编号</div>
							<div class="th w5">手机名称</div>
							<div class="th w10">手机版本</div>
							<div class="th w10">屏幕大小/寸</div>
							<div class="th w5">ROM</div>
							<div class="th w5">RAM</div>
							<div class="th w10">价格</div>
							<div class="th w10">上市时间</div>
							<div class="th w10">图片</div>
							<div class="th w10">可售数量</div>
							<div class="th w10">库存数量</div>
							<div class="th w10">操作</div>
						</div>

<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+"/";
%>


						<c:forEach items="${list}" var="em">
							<div class="tr clearfix border-bottom-none">
								<div class="td w5">${em.id}</div>
								<div class="td w5">${em.goodsName}</div>
								<div class="td w10">${em.version}</div>
								<div class="td w10">${em.screenSize}</div>
								<div class="td w5">${em.rom}</div>
								<div class="td w5">${em.ram}</div>
								<div class="td w10">${em.price}</div>
								<div class="td w10">${em.timeMarket}</div>
								<div class="td w10">
									<img src="${pageContext.request.contextPath}/images/${em.icon}"
										width="50px" height="50px" />
								</div>
								<div class="td w10">${em.saleSum}</div>
								<div class="td w10">${em.realSum}</div>

								<div class="td w10">
									<a
										href="${pageContext.request.contextPath}/goods/toUpdate?id=${em.id}"
										class="button-word2 btn_ajax_confirm">更新</a> <a
										href="${pageContext.request.contextPath}/goods/delete?id=${em.id}"
										class="button-word2 btn_ajax_confirm"
										onclick="return formSub1()">删除</a>
								</div>
							</div>
						</c:forEach>


					</div>
				</div>
				<div class="show-page padding-big-right">
												<div class="page">
													<div class="page">

														<div class="offcial-page margin-top margin-big-right" style="float: left;margin-left: 80%">
															共${page.totalPageCount}页 | 
															第 ${page.pageNow}页
															 [
															<a href="#" class="right-font08" onclick="firstPage();">首页</a>
															|
															<a href="#" class="right-font08"
																onclick="previousPage();">上一页</a> |
															<a href="#" class="right-font08" onclick="nextPage();">下一页</a>
															|
															<a href="#" class="right-font08" onclick="lastPage();">末页</a>
															]
															
														</div>
													</div>
												</div>
											</div>
			</div>


			<!-- 条件查询 -->
<%-- 
			<div class="authority-content" id="tashow">
	<div class="list-content show">
					<div class="offcial-table  tr-border margin-big-top clearfix">
						
							<div class="tr-th clearfix">
								
									<div class="th w5">手机编号</div>
									<div class="th w5">手机名称</div>
									<div class="th w10">手机版本</div>
									<div class="th w10">屏幕大小/寸</div>
									<div class="th w5">ROM</div>
									<div class="th w5">RAM</div>
									<div class="th w10">价格</div>
									<div class="th w10">上市时间</div>
									<div class="th w10">图片</div>
									<div class="th w10">可售数量</div>
									<div class="th w10">库存数量</div>
									<div class="th w10">操作</div>
								
							</div>


							<c:forEach items="${list}" var="en" varStatus="index">

								<div class="tr clearfix border-bottom-none">

									<div class="td w5">${en.id}</div>
									<div class="td w5">${en.goodsName}</div>
									<div class="td w10">${en.version}</div>
									<div class="td w10">${en.screenSize}</div>
									<div class="td w5">${en.rom}</div>
									<div class="td w5">${en.ram}</div>
									<div class="td w10">${en.price}</div>
									<div class="td w10">${en.timeMarket}</div>
									<div class="td w10">
										<img
											src="${pageContext.request.contextPath}/images/${en.icon}"
											width="50px" height="50px" />
									</div>
									<div class="td w10">${en.saleSum}</div>
									<div class="td w10">${en.realSum}</div>
									<div class="td w10">
										<a
											href="${pageContext.request.contextPath}/goods/toUpdate?id=${en.id}"
											class="button-word2 btn_ajax_confirm">更新</a> <a
											href="${pageContext.request.contextPath}/goods/delete?id=${en.id}"
											class="button-word2 btn_ajax_confirm"
											onclick="return formSub1()">删除</a>
									</div>

								</div>

							</c:forEach>

							</div>
							</div> 
							

											

								</div> --%>
								
								</div>			

										</div>	


											<!-- 下拉功能 -->
											<script>
												$(".sidebar-title")
														.live(
																'click',
																function() {
																	if ($(this)
																			.parent(
																					".sidebar-nav")
																			.hasClass(
																					"sidebar-nav-fold")) {
																		$(this)
																				.next()
																				.slideDown(
																						200);
																		$(this)
																				.parent(
																						".sidebar-nav")
																				.removeClass(
																						"sidebar-nav-fold");
																	} else {
																		$(this)
																				.next()
																				.slideUp(
																						200);
																		$(this)
																				.parent(
																						".sidebar-nav")
																				.addClass(
																						"sidebar-nav-fold");
																	}
																});
											


											<!-- 点击条件查询页面覆盖查询所有 -->
										/* 
												$(document).ready(function() {
													$("#tashow").hide();
												})

												function tableHi() {
													$("#ta").hide();
													$("#tashow").show();

												}  */

												/*弹框  */
												(function() {
													/* if(${index.count}!=1){alert("hah!")} */
													/* if('${en.rom}'==''){alert("hah!")
														return false;} */
													/* if($("#td2")){
														alert("找到结果！");
													}
													else{alert("没有找到结果！");
														
													} */
													/* else{
														alert("没有找到结果！");
													} */
													/* if(aa=1){
														alert("没有找到结果！");
													} */
													/* if('${en.version}'==""){
														alert("没有找到结果！")
													} */
													/* if (tab.rows.length == 2) {
														alert("没有找到结果！");
													} */
												}())

												/* 控制编号查询只能输入数字 */
												function chkads() {
													if (!IsNum(my.i.value)) {
														alert("商品编号请输入数字!")
														my.i.focus();
														my.g.focus();
														return false;
													}
													my.i.focus();
													my.g.focus();
												}
												function IsNum(num) {
													var reNum = /^\d*$/;
													return (reNum.test(num));
												}
												/*删除的弹框  */
												function formSub1() {
													var msg = "您真的确定要删除吗？";
													if (confirm(msg) == true) {
													} else {
														alert("删除失败");
														return false;
													}
												}

												//当前第几页数据
												var currentPage = ${page.pageNow};
												
												//总页数
												var totalPage = ${page.totalPageCount};
												//第一页
												function firstPage() {
													if (currentPage == 1) {
														alert("已经是第一页数据");
														return false;
													} else {
														window.location.href = "${pageContext.request.contextPath }/goods/goods?pageNow=1";
														return true;
													}
												}
												//下一页
												function nextPage() {
													if (currentPage == totalPage) {
														alert("已经是最后一页数据");
														return false;
													} else {
														window.location.href = "${pageContext.request.contextPath }/goods/goods?pageNow="
																+ (currentPage + 1);
														return true;
													}
												}
												//上一页
												function previousPage() {
													if (currentPage == 1) {
														alert("已经是第一页数据");
														return false;
													} else {
														window.location.href = "${pageContext.request.contextPath }/goods/goods?pageNow="
																+ (currentPage - 1);
														return true;
													}
												}
												//尾页
												function lastPage() {
													if (currentPage == totalPage) {
														alert("已经是最后一页数据");
														return false;
													} else {

														window.location.href = "${pageContext.request.contextPath }/goods/goods?pageNow="+(totalPage);
														return true;
													}
												} 
											</script>
</body>
</html>